package com.jt.www.enums.endorse;

/**
 * 证件类型
 */

public enum CertificateTypeEnum {
    ID_CARD("身份证", 1),
    PASSPORT("护照", 2),
    STUDENT_CARD("学生证", 3),
    ACCOUNT("户口本", 4),
    OTHER("其他", 5);

    private String msg;
    private byte code;

    CertificateTypeEnum(String msg, int code) {
        this.msg = msg;
        this.code = (byte) code;
    }

    public static byte getCodeByMsg(String msg) {
        for (CertificateTypeEnum typeEnum : CertificateTypeEnum.values()) {
            if (typeEnum.msg.equals(msg)) {
                return typeEnum.getCode();
            }
        }
        return 0;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public byte getCode() {
        return code;
    }

    public void setCode(byte code) {
        this.code = code;
    }
}
